#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
Provides a dictionary of QTextCharFormat
"""

__date__ = "26 avr. 2010"
__author__ = "INRIA pyLot"
__all__ = [
  u'PYLOT_CHAR_FORMATS',
  u'PYLOT_CHAR_FORMAT_STD',
  u'PYLOT_CHAR_FORMAT_TITLE',
  u'PYLOT_CHAR_FORMAT_WARN',
  u'PYLOT_CHAR_FORMAT_INFO',
  ]

from PyQt4.QtGui import QTextCharFormat, QBrush, QColor
from PyQt4.QtCore import Qt

PYLOT_CHAR_FORMATS = {}

PYLOT_CHAR_FORMAT_STD = QTextCharFormat()
PYLOT_CHAR_FORMAT_STD.setForeground(Qt.black)
PYLOT_CHAR_FORMAT_STD.setBackground(QBrush(QColor(255, 255, 255, 0)))
PYLOT_CHAR_FORMAT_STD.setFontFamily(u'Mono')
PYLOT_CHAR_FORMATS[u'std'] = PYLOT_CHAR_FORMAT_STD

PYLOT_CHAR_FORMAT_TITLE = QTextCharFormat()
PYLOT_CHAR_FORMAT_TITLE.setForeground(QBrush(QColor(0, 0, 255, 255)))
PYLOT_CHAR_FORMAT_TITLE.setBackground(QBrush(QColor(255, 255, 255, 0)))
PYLOT_CHAR_FORMATS[u'title'] = PYLOT_CHAR_FORMAT_TITLE

PYLOT_CHAR_FORMAT_WARN = QTextCharFormat()
PYLOT_CHAR_FORMAT_WARN.setForeground(QBrush(QColor(255, 0, 0, 255)))
PYLOT_CHAR_FORMAT_WARN.setBackground(QBrush(QColor(255, 255, 255, 0)))
PYLOT_CHAR_FORMATS[u'warn'] = PYLOT_CHAR_FORMAT_WARN

PYLOT_CHAR_FORMAT_INFO = QTextCharFormat()
PYLOT_CHAR_FORMAT_INFO.setForeground(QBrush(QColor(0, 0, 0, 255)))
PYLOT_CHAR_FORMAT_INFO.setBackground(QBrush(QColor(255, 255, 255, 0)))
PYLOT_CHAR_FORMATS[u'info'] = PYLOT_CHAR_FORMAT_INFO

if __name__ == '__main__':
  import doctest
  doctest.testmod()


